<%@ page import="java.awt.print.Book" %>
<%@ page import="com.edu.bean.User" %>
<%@ page import="com.github.pagehelper.PageInfo" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/11/9
  Time: 10:59
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书本</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/book.css"/>
</head>
<body>
<div>
<h2>欢迎${loginUser.realName}用户：</h2>
<div class="page">
    <c:if test="${pageNum != 1}">
        <c:if test="${pageCount > 1}">
            <a href="${pageContext.request.contextPath}/books/selectBookAll?pageNum=1">首页</a>
        </c:if>
    </c:if>
    <c:if test="${pageNum > 1}">
        <a href="${pageContext.request.contextPath}/books/selectBookAll?pageNum=${pageNum-1}">上一页</a>
    </c:if>
    <c:if test="${pageNum < pageCount}">
        <a href="${pageContext.request.contextPath}/books/selectBookAll?pageNum=${pageNum+1}">下一页</a>
    </c:if>
    <c:if test="${pageNum != pageCount}">
        <c:if test="${pageCount > 1}">
            <a href="${pageContext.request.contextPath}/books/selectBookAll?pageNum=${pageCount}">尾页</a>
        </c:if>
    </c:if>
    <p>当前页码：${pageNum}</p>
</div>
<p class="msg">${msg}</p>
<table>
    <tr>
        <th>序号</th>
        <th>书名</th>
        <th>操作</th>

    </tr>
    <c:forEach items="${bookList}" var="book" varStatus="vs">
        <tr>
            <td>${vs.count}</td>
            <td class="book_name"><a href="${pageContext.request.contextPath}/books/${book.bookId}">${book.bookName}</a></td>
            <td class="book_button">
                <a href="${pageContext.request.contextPath}/books/selectUpdateBookId/${book.bookId}">修改</a>
                <a href="${pageContext.request.contextPath}/books/deleteBook/${book.bookId}">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</div>
</body>
</html>
